package com.ad2campaign.engine.web;
import java.util.Map;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class Home {
    
	
	@Value("${isMasterNode}")
	private boolean isMaster;
	
	@RequestMapping("/")
    public ModelAndView home(Map<String, Object> model) throws Exception
    {
    	try 
    	{ 
        	model.put("mode", isMaster?"MASTER":"SLAVE");
    	} catch (Exception e) {
	 		
	 		
		}

        return new ModelAndView("index");
    }
}
